#ifndef __KEY_Init_
#define __KEY_Init_

#ifdef __cplusplus
extern "C" {
#endif

#include "apm32f0xx_gpio.h"
#include "apm32f0xx_eint.h"
#include "apm32f0xx_misc.h"
#include "apm32f0xx_syscfg.h"
#include "Board.h"
#include "stdio.h"
#include "delay.h"
#include "timer.h"
#include "usart.h"

extern u8 Key_Value;
extern u8 key_flag;
extern u8 Key_stat;

#define KEY_STATE_0    0
#define KEY_STATE_1    1
#define KEY_STATE_2    2
#define KEY_STATE_3    3
#define KEY_STATE_4    4

enum ON_OFF_state         //开关机状态
{
	ON_state,       //开机状态
	OFF_state      // 关机状态
};


enum Run_Mode         //开关机状态
{
	continuity_Mode = 0,       //持续模式
	interval_Mode,    			  // 间歇模式
	clear_Mode,    					//清理模式
	Null_Mode
};

extern u8 Key_WIFI_flag;
extern u8 key_mach_flag;
extern u8 switch_1_flag;
#define N_KEY       0      //没按
#define S_KEY       1      //短按
#define D_KEY       2      //双击
#define T_KEY       3      //三击
#define Q_KEY       4      //四击
#define F_KEY       5      //五击
#define L_KEY       10     //长按





void Key_Init(void);
u8 Key_GetSate(void);
unsigned char key_driver(void);
u8 key_read(void);
void Key_Tick(void);
u8 Key_mach(void);
void Key_button(void);
void KEY_Guess(void);
#ifdef __cplusplus
}
#endif

#endif
